[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
REG...() (BOOLEAN, INTEGER)
Function
Get the value of a register.
Syntax
REG...() No arguments are required
REG should be followed by one of the following register names: AH, AL,
AX, BH, BL, BX, CF, CH, CL, CX, DH, DI, DL, DS, DX, ES, F or SI.
Return Type & Value
BOOLEAN
(REGCF() only) Returns TRUE if the carry flag is set, FALSE otherwise.
INTEGER
(All others) Returns the value in the specified register.
Remarks
There are actually 18 different functions that return the values of
registers. AL, AH, BL, BH, CL, CH, DL, and DH will always return byte
sized values (0-255). AX, BX, CX, DX, DI, SI, DS, and ES will always
return word sized values (0-65535). F (flags) returns the settings for
the various 80x86 processor flags. CF is a subset of F in that it only
returns the status of the carry flag. It exists because the carry flag
is often used to report success or failure in assembly language.
The REGF() function returns the settings for the following flags: Carry,
Parity, Auxilliary, Zero, Sign, Trap, Interrupt, Direction, and Overflow.
Their bit positions are as follows:
Overflow = O = 800h
Direction = D = 400h
Interrupt = I = 200h
Trap = T = 100h
Sign = S = 080h
Zero = Z = 040h
- 020h
Auxilliary = A = 010h
- 008h
Parity = P = 004h
- 002h
Carry = C = 001h
Examples
' Create subdirectory - DOS function 39h
INTEGER addr
STRING path
LET path = "C:\$TMPDIR$"
VARADDR path,addr
DOINTR 21h,39h,0,0,addr%00010000h,0,0,0,addr/00010000h,0
IF (REGCF() & (REGAX() = 3)) THEN
PRINTLN "Error: Path not found"
ELSE IF (REGCF() & (REGAX() = 5)) THEN
PRINTLN "Error: Access Denied"
ELSE IF (REGCF()) THEN
PRINTLN "Error: Unknown Error"
ELSE
PRINTLN "Directory successfully created..."
ENDIF
See Also:
B2W()
DOINTR
VARADDR
VAROFF
VARSEG
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson